//
//  OAToolBox.m
//  OASystem
//
//  Created by zhoupengfei on 15/4/5.
//  Copyright (c) 2015年 zpf. All rights reserved.
//

#import "OAToolBox.h"

@implementation OAToolBox
+(CGFloat)sizebyText:(NSString*)string font:(int)font minsWidth:(CGFloat)width{
    
    NSDictionary * dic = @{NSFontAttributeName: [UIFont systemFontOfSize:font]};
    CGRect rect = [string boundingRectWithSize:CGSizeMake(KScreenWidth - width, 0) options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:dic context:nil];
    return rect.size.height;
}
+ (CGFloat)heightbyString:(NSString *)string font:(int)font minsWidth:(CGFloat)width{
    NSDictionary *dict = @{NSFontAttributeName:[UIFont systemFontOfSize:font]};

    CGRect rect = [string boundingRectWithSize:CGSizeMake(KScreenWidth - width, 0) options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:dict context:nil];

    return rect.size.height;
}

@end
